package acceptanceTest;

import java.util.List;

import org.joda.time.DateTime;

import com.acmetelecom.BillingSystem;
import com.acmetelecom.customer.CentralCustomerDatabase;
import com.acmetelecom.customer.Customer;

import static junit.framework.Assert.*;

// JUnit Assert framework can be used for verification

public class Calls {

	
	public void callFromToBegins(String caller, String callee) throws Exception {
		SystemUnderTest.billingSystem.callInitiated(caller, callee,SystemUnderTest.getDt());				
	}

	public void callFromToEnds(String caller, String callee) throws Exception {
		SystemUnderTest.billingSystem.callCompleted(caller, callee,SystemUnderTest.getDt());	
	}
	
	public static void afterSeconds(int seconds) throws Exception {
		DateTime current = SystemUnderTest.getDt();
		SystemUnderTest.setDt(current.plusSeconds(seconds));
}



	public void setCurrentTime(String dateTime) throws Exception {
		String[] times = dateTime.split(",");
		int year = Integer.parseInt(times[0]);
		int month = Integer.parseInt(times[1]);
		int day = Integer.parseInt(times[2]);
		int hour = Integer.parseInt(times[3]);
		int min = Integer.parseInt(times[4]);
		int sec = Integer.parseInt(times[5]);
		
		SystemUnderTest.setDt(new DateTime(year,month,day,hour,min,sec));
	}

}
